package com.ctvit.framework.dao;

import java.util.ArrayList;
import java.util.List;

public class OrderPart {
	public static final String ASC = "ASC";
	public static final String DESC = "DESC";
	List items = new ArrayList();

	public static OrderPart newInstance() {
		return new OrderPart();
	}

	public OrderPart add(String propname) {
		return add(propname, ASC);
	}

	public OrderPart add(String propname, String order) {
		items.add(new Part(propname, order));
		return this;
	}

	public List getItems() {
		return items;
	}

	class Part {
		private String name;
		private String order;

		public Part(String name, String order) {
			this.name = name;
			this.order = order;
		}

		public String getName() {
			return name;
		}

		public void setName(String name) {
			this.name = name;
		}

		public String getOrder() {
			return order;
		}

		public void setOrder(String order) {
			this.order = order;
		}
	}

}